package com.youhome.service.service.impl;

import com.youhome.common.exception.CustomException;
import com.youhome.service.mapper.HotCityMapper;
import com.youhome.service.model.HotCity;
import com.youhome.service.model.HotCityHouseCount;
import com.youhome.service.service.HotCityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by chen365 on 2018/08/06.
 */
@Service
public class HotCityServiceImpl implements HotCityService {

    @Autowired
    private HotCityMapper hotCityMapper;

    @Override
    public List<HotCity> selectAll() {
        return hotCityMapper.selectAll();
    }

    @Override
    public List<HotCity> selectByBean(HotCity record) {
        return hotCityMapper.selectByBean(record);
    }

    @Override
    public List<HotCityHouseCount> selectHotCityHouseCount() {

        return hotCityMapper.selectHouseCount();

    }

    @Override
    public List<HotCity> selectByEnabled(Boolean enabled) throws CustomException {
        HotCity record = new HotCity();
        record.setEnabled(true);
        return hotCityMapper.selectByBean(record);
    }
}
